package com.ruoyi.edh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.edh.mapper.EdhSupplierMapper;
import com.ruoyi.edh.domain.EdhSupplier;
import com.ruoyi.edh.service.IEdhSupplierService;

/**
 * 易订货-供应商Service业务层处理
 * 
 * @author xxx
 * @date 2020-09-03
 */
@Service
public class EdhSupplierServiceImpl implements IEdhSupplierService 
{
    @Autowired
    private EdhSupplierMapper edhSupplierMapper;

    /**
     * 查询易订货-供应商
     * 
     * @param id 易订货-供应商ID
     * @return 易订货-供应商
     */
    @Override
    public EdhSupplier selectEdhSupplierById(Long id)
    {
        return edhSupplierMapper.selectEdhSupplierById(id);
    }

    /**
     * 查询易订货-供应商列表
     * 
     * @param edhSupplier 易订货-供应商
     * @return 易订货-供应商
     */
    @Override
    public List<EdhSupplier> selectEdhSupplierList(EdhSupplier edhSupplier)
    {
        return edhSupplierMapper.selectEdhSupplierList(edhSupplier);
    }

    /**
     * 新增易订货-供应商
     * 
     * @param edhSupplier 易订货-供应商
     * @return 结果
     */
    @Override
    public int insertEdhSupplier(EdhSupplier edhSupplier)
    {
        edhSupplier.setCreateTime(DateUtils.getNowDate());
        return edhSupplierMapper.insertEdhSupplier(edhSupplier);
    }

    /**
     * 修改易订货-供应商
     * 
     * @param edhSupplier 易订货-供应商
     * @return 结果
     */
    @Override
    public int updateEdhSupplier(EdhSupplier edhSupplier)
    {
        edhSupplier.setUpdateTime(DateUtils.getNowDate());
        return edhSupplierMapper.updateEdhSupplier(edhSupplier);
    }

    /**
     * 批量删除易订货-供应商
     * 
     * @param ids 需要删除的易订货-供应商ID
     * @return 结果
     */
    @Override
    public int deleteEdhSupplierByIds(Long[] ids)
    {
        return edhSupplierMapper.deleteEdhSupplierByIds(ids);
    }

    /**
     * 删除易订货-供应商信息
     * 
     * @param id 易订货-供应商ID
     * @return 结果
     */
    @Override
    public int deleteEdhSupplierById(Long id)
    {
        return edhSupplierMapper.deleteEdhSupplierById(id);
    }
}
